local M = {}

M.get_path = function(state)
 local node = state.tree:get_node()
 if node.type == 'directory' then
    return node.path
 end
 return node:get_parent_id()
end

M.get_path_or_file_name = function(state)
 local node = state.tree:get_node()
 if node.type == 'directory' then
    return node.path
 end
 return node:get_id()
end

M.do_setcd = function(state)
 local p = M.get_path(state)
 vim.cmd(string.format('exec(":lcd %s")',p))
 return p
end

return M
-- EOP

